﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;

namespace CIS470MetricsTracking
{
    public class ChartController
    {
        public DataTable getChartReports(string project_name, string chart_name)
        {
            string query;

            DataSet ds = new DataSet();
            DataTable dt = new DataTable();

            query = "select * from Q_ProjectReportedResults where projectName='" + project_name + "' and indicatorName='" + chart_name + "'";
            ds = ControllerManager.data_controller.executeSelectQuery(query);
            dt = ds.Tables[0];

            return dt;
        }

        public DataTable getChartBaselines(string project_name, string chart_name)
        {
            string query;

            DataSet ds = new DataSet();
            DataTable dt = new DataTable();

            query = "select * from Q_ProjectBaselines where projectName='" + project_name + "' and indicatorName='" + chart_name + "'";
            ds = ControllerManager.data_controller.executeSelectQuery(query);
            dt = ds.Tables[0];

            return dt;
        }
    }
}
